* {
    padding: 0;
    margin: 0;
}

body {
    background: #e84118;
}

.search-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #2f3640;
    height: 40px;
    border-radius: 40px;
    padding: 10px;
}

.search-box:hover>.search-txt {
    /* 设置transition延迟时间，然后可以通过hover来更改长度 就能达到一个慢慢边长的动画效果 */
    width: 240px;
    padding: 0 6px;
}

.search-box:hover>.search-btn {
    background: white;
}

.search-btn {
    color: #e84118;
    float: right;
    height: 40px;
    width: 40px;
    border-radius: 50%;
    /* flex布局 能够把内容居中 */
    display: flex;
    background: #2f3640;
    justify-content: center;
    align-items: center;
}

.search-txt {
    background: none;
    border: none;
    /* 去除文本框的外边栏 */
    outline: none;
    height: 40px;
    width: 0;
    float: left;
    font-size: 16px;
    line-height: 40px;
    /* transition动画持续时间 */
    transition: 1s;
    color: white;
}